package com.example.springboot159.springboot.chapter03;

import java.util.HashMap;
import java.util.Map;

public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry{
    //key :beanName
    //value:bean对象
    private Map<String,Object> singletonMaps = new HashMap<>();
    @Override
    public Object getSingleton(String name) {
        return singletonMaps.get(name);
    }

    protected void addSingleton(String name,Object singletonObject){
        singletonMaps.put(name,singletonObject);
    }
}
